package net.spider.tools.page;

import org.jsoup.nodes.Element;
import org.jsoup.parser.Tag;

public class PickUpItem implements Cloneable{
	//提取块的名称
	private String name;
	//匹配类型
	private MatchType matchType;
	//匹配规则
	private String pattern;
	//提取块的描述
	private String comments;
	//提取结果
	private Element targetElement;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public MatchType getMatchType() {
		return matchType;
	}
	public void setMatchType(MatchType matchType) {
		this.matchType = matchType;
	}
	public String getPattern() {
		return pattern;
	}
	public void setPattern(String pattern) {
		this.pattern = pattern;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public Element getTargetElement() {
		return null==targetElement?new Element(Tag.valueOf("null"),""):targetElement;
	}
	public void setTargetContent(Element targetElement) {
		this.targetElement = targetElement;
	}
	
	@Override
	protected PickUpItem clone(){
		try {
			return (PickUpItem) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
			return null;
		}
	}
}
